package com.neu.wangxiaoyang.dao;

import com.neu.commons.Dao.BaseDao;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class ImplQueryDao {
    public List<Map<String,Object>> findpage(int pageIndex, int pageNum) {
        List<Map<String, Object>> list=null;
        BaseDao b=new BaseDao();
        int end=pageIndex*pageNum;
        int begin=(pageIndex-1)*pageNum;
        String sql=" select * from(select a.*, rownum r  from (select * from t_vst_info order by vst_id desc )a where rownum<=?) b  where r>=?";
        list= b.BaseDaoQuery(sql,end,begin);
        return list;
    }
    public List<Map<String,Object>> visitQuery(int pageCount) {
        List<Map<String,Object>>list=new ArrayList<>();
        BaseDao b=new BaseDao();
        String sql="select  ceil(count(vst_id)/?)a from t_vst_info";
        list=b.BaseDaoQuery(sql,pageCount);
        return list;
    }
}
